home *** CD-ROM | disk | FTP | other *** search
- #include <sane.h>
- #include <LowMem.h>
- #include <A4Stuff.h>
- #include <QuickDraw.h>
- #include <Memory.h>
- #include <Resources.h>
- #include <Fonts.h>
- #include <Dialogs.h>
- #include <QDOffscreen.h>
- #include <string.h>
- #include <stdio.h>
- #include <Timer.h>
-
- char *memLoc = 0;
- int wavePos = 0;
-
-
- void initWavePlug()
- {
- }
-
- void disposeWavePlug()
- {
- }
-
- typedef struct {
- TMTask task;
- Ptr mainBaseAddr;
- Size worldBytes;
- Ptr worldBuffer;
- short rowBytes;
- short phase;
- Rect size;
- short offset;
- } MyTaskRec;
-
- void doWavePlug(MyTaskRec* myTask)
- {
- EnterCodeResource ();
- short height = myTask -> size.bottom - myTask -> size.top;
- short phase = myTask -> phase;
- short rowBytes = myTask -> rowBytes;
- Ptr worldBuffer = myTask -> worldBuffer;
- Ptr screenBuffer = myTask -> mainBaseAddr;
-
-
- int i;
- for(i = 0; i < height; i++)
- {
- unsigned char ch;
- char *j;
- char *k;
-
- k = screenBuffer + i * rowBytes;
- for(j = worldBuffer + i * rowBytes; j <= worldBuffer + i * rowBytes + rowBytes - 1 ; j++)
- {
- memLoc++;
- ch = *memLoc % 67;
-
- if(memLoc > (char *)0x00040000)
- memLoc = 0;;
-
- if(ch == 65)
- *k = 0;
- else
- if(ch == 27)
- *k = 255;
- else
- *k = *j;
-
- k++;
- }
- }
- ExitCodeResource ();
- }
-
-